package net.hubt.itc.ui;

/***********************************************************************
 * 																	   *
 *Programmer: Tiep, Nguyen											   *
 *																	   *
 *Last Modify: Nov, 23th, 2012										   *
 *Add userClass to BaseActivity.java								   *
 *Version: 1.0														   *
 *																	   *
 ***********************************************************************/

import android.app.Activity;
import android.os.Bundle;


public class BaseActivity extends Activity {

	protected HUBTApplication mApplicationContext;

	protected String baseUrl;
	protected String userId;
	protected String phoneNo;
	protected String userClass;
	/**
     * init global preferences
     */
    public void initPrefs(){
    	if(mApplicationContext==null){
    		mApplicationContext=(HUBTApplication)getApplication();
    	}
    }
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {    
    	super.onCreate(savedInstanceState);
//    	requestWindowFeature(android.view.Window.FEATURE_NO_TITLE);
    	initPrefs();
    }
    
    protected void prepareParamsForTask(){
    	baseUrl = mApplicationContext.getUserPrefs().getBaseUrl();
		userId = mApplicationContext.getUserPrefs().getUserId();
		userClass = mApplicationContext.getUserPrefs().getUserClass();
		// se truyen tham so phoneNo khi cap nhat day du DB de validate
		// String phoneNo=mApplicationContext.getUserPrefs().getPhoneNo();
		// se truyen tham so phoneNo khi cap nhat day du DB de validate
		phoneNo = mApplicationContext.getPhoneNumber();
    }
}
